const koa = require("koa");
const bodyParser = require("koa-bodyparser");
const registerRouters = require("../router");

const app = new koa();

// 使用node 自动加载router文件夹里的路由

app.use(bodyParser());
registerRouters(app);

/*
 * 手动注册
 */

// const loginRouter = require("../router/login.router");
// const userRouter = require("../router/user.router");
// app.use(userRouter.routes());
// app.use(loginRouter.routes());
// app.use(userRouter.allowedMethods());

module.exports = app;
